package com.corpgovernment.permission.entity;

import java.util.Arrays;

/**
 * @author zl.cui
 * @date 2022/9/19
 */
public enum ResourceType {
    /**
     * 菜单
     */
    MENU("menu"),
    SUBMENU("subMenu"),
    /**
     * 按钮
     */
    BTN("button");
    private String type;
    ResourceType(String type) {
        this.type = type;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public ResourceType getResourceType(String type){
        return Arrays.stream(ResourceType.values())
                .filter(t -> t.getType().equalsIgnoreCase(type))
                .findFirst()
                .orElse(MENU);
    }
}
